home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 1.iso / ARGONET / PD / MATHS / RLAB / RLAB125.ZIP / !RLaB / misc / rlab-mode. < prev    next >
Lisp/Scheme  |  1994-06-03  |  18KB  |  632 lines

  1. ;; rlab-mode.el - A major-mode for editing rlab scripts
  2. ;; Shamelessly stolen from tcl-mode.el
  3. ;;
  4. ;; Original
  5. ;; Author: Gregor Schmid <schmid@fb3-s7.math.tu-berlin.de>
  6. ;; Keywords: languages, processes, tools
  7. ;;
  8. ;; Subsequent
  9. ;; Hacked by: Ian Searle
  10. ;;
  11. ;; Copyright (C) 1993, 1994 Free Software Foundation, Inc.
  12. ;; Version 1.1
  13.  
  14. ;; This file is part of GNU Emacs.
  15.  
  16. ;; GNU Emacs is free software; you can redistribute it and/or modify
  17. ;; it under the terms of the GNU General Public License as published by
  18. ;; the Free Software Foundation; either version 2, or (at your option)
  19. ;; any later version.
  20.  
  21. ;; GNU Emacs is distributed in the hope that it will be useful,
  22. ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  23. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  24. ;; GNU General Public License for more details.
  25.  
  26. ;; You should have received a copy of the GNU General Public License
  27. ;; along with GNU Emacs; see the file COPYING.  If not, write to
  28. ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  29.  
  30. ;; Please send improvments, bug-fixes, suggestions etc. to
  31. ;;
  32. ;;         ians@eskimo.com
  33. ;;
  34.  
  35. ;; This file was written with emacs using Jamie Lokier's folding mode
  36. ;; That's what the funny ;;{{{ marks are there for
  37.  
  38. ;;{{{ Usage
  39.  
  40. ;;; Commentary:
  41.  
  42. ;; RLaB-mode supports c-mode style formatting and sending of
  43. ;; lines/regions/files to a rlab interpreter. An interpreter (see
  44. ;; variable `rlab-default-application') will be started if you try to
  45. ;; send some code and none is running. You can use the process-buffer
  46. ;; (named after the application you chose) as if it were an
  47. ;; interactive shell. See the documentation for `comint.el' for
  48. ;; details.
  49.  
  50. ;; Another version of this package which has support for other Emacs
  51. ;; versions is in the LCD archive.
  52.  
  53. ;;}}}
  54. ;;{{{ Key-bindings
  55.  
  56. ;; To see all the keybindings for folding mode, look at `rlab-setup-keymap'
  57. ;; or start `rlab-mode' and type `\C-h m'.
  58. ;; The keybindings may seem strange, since I prefer to use them with
  59. ;; rlab-prefix-key set to nil, but since those keybindings are already used
  60. ;; the default for `rlab-prefix-key' is `\C-c', which is the conventional
  61. ;; prefix for major-mode commands.
  62.  
  63. ;; You can customise the keybindings either by setting `rlab-prefix-key'
  64. ;; or by putting the following in your .emacs
  65. ;;     (setq rlab-mode-map (make-sparse-keymap))
  66. ;; and
  67. ;;     (define-key rlab-mode-map <your-key> <function>)
  68. ;; for all the functions you need.
  69.  
  70. ;;}}}
  71. ;;{{{ Variables
  72.  
  73. ;; You may want to customize the following variables:
  74. ;;     rlab-indent-level
  75. ;;     rlab-always-show
  76. ;;    rlab-mode-map
  77. ;;    rlab-prefix-key
  78. ;;    rlab-mode-hook
  79. ;;     rlab-default-application
  80. ;;     rlab-default-command-switches
  81.  
  82. ;;}}}
  83.  
  84. ;;; Code:
  85.  
  86. ;; We need that !
  87. (require 'comint)
  88.  
  89. ;;{{{ variables
  90.  
  91. (defvar rlab-default-application "rlab"
  92.   "Default rlab application to run in rlab subprocess.")
  93.  
  94. (defvar rlab-default-command-switches nil
  95.   "Command switches for `rlab-default-application'.
  96. Should be a list of strings.")
  97.  
  98. (defvar rlab-process nil
  99.   "The active rlab subprocess corresponding to current buffer.")
  100.  
  101. (defvar rlab-process-buffer nil
  102.   "Buffer used for communication with rlab subprocess for current buffer.")
  103.  
  104. (defvar rlab-always-show t
  105.   "*Non-nil means display rlab-process-buffer after sending a command.")
  106.  
  107. (defvar rlab-mode-map nil
  108.   "Keymap used with rlab mode.")
  109.  
  110. (defvar rlab-prefix-key "\C-c"
  111.   "Prefix for all rlab-mode commands.")
  112.  
  113. (defvar rlab-mode-hook nil
  114.   "Hooks called when rlab mode fires up.")
  115.  
  116. (defvar rlab-region-start (make-marker)
  117.   "Start of special region for rlab communication.")
  118.  
  119. (defvar rlab-region-end (make-marker)
  120.   "End of special region for rlab communication.")
  121.  
  122. (defvar rlab-indent-level 2
  123.   "Amount by which rlab subexpressions are indented.")
  124.  
  125. (defvar rlab-default-eval ""
  126.   "Default command used when sending regions.")
  127.  
  128. (defvar rlab-mode-menu (make-sparse-keymap "RLaB-Mode")
  129.   "Keymap for rlab-mode's menu.")
  130.  
  131. ;;}}}
  132. ;;{{{ rlab-mode
  133.  
  134. ;;;###autoload
  135. (defun rlab-mode ()
  136.   "Major mode for editing rlab scripts.
  137. The following keys are bound:
  138. \\{rlab-mode-map}
  139. "
  140.   (interactive)
  141.   (let ((switches nil)
  142.     s)
  143.     (kill-all-local-variables)
  144.     (setq major-mode 'rlab-mode)
  145.     (setq mode-name "RLaB")
  146.     (set (make-local-variable 'rlab-process) nil)
  147.     (set (make-local-variable 'rlab-process-buffer) nil)
  148.     (make-local-variable 'rlab-default-command-switches)
  149.     (set (make-local-variable 'indent-line-function) 'rlab-indent-line)
  150.     (set (make-local-variable 'comment-start) "#")
  151.     (set (make-local-variable 'comment-start-skip) "\\(\\(^\\|;\\)[ \t]*\\)#")
  152.     (make-local-variable 'rlab-default-eval)
  153.     (or rlab-mode-map
  154.     (rlab-setup-keymap))
  155.     (use-local-map rlab-mode-map)
  156.     (modify-syntax-entry ?# "<")
  157.     (modify-syntax-entry ?\n ">")
  158.     ;; look for a #!.../wish -f line at bob
  159.     (save-excursion
  160.       (goto-char (point-min))
  161.       (if (looking-at "#![ \t]*\\([^ \t]*\\)[ \t]\\(.*[ \t]\\)*-f")
  162.       (progn
  163.         (set (make-local-variable 'rlab-default-application)
  164.          (buffer-substring (match-beginning 1)
  165.                    (match-end 1)))
  166.         (if (match-beginning 2)
  167.         (progn
  168.           (goto-char (match-beginning 2))
  169.           (set (make-local-variable 'rlab-default-command-switches) nil)
  170.           (while (< (point) (match-end 2))
  171.             (setq s (read (current-buffer)))
  172.             (if (<= (point) (match-end 2))
  173.             (setq rlab-default-command-switches
  174.                   (append rlab-default-command-switches
  175.                       (list (prin1-to-string s)))))))))
  176.     ;; if this fails, look for the #!/bin/csh ... exec hack
  177.     (while (eq (following-char) ?#)
  178.       (forward-line 1))
  179.     (or (bobp)
  180.         (forward-char -1))
  181.     (if (eq (preceding-char) ?\\)
  182.         (progn
  183.           (forward-char 1)
  184.           (if (looking-at "exec[ \t]+\\([^ \t]*\\)[ \t]\\(.*[ \t]\\)*-f")
  185.           (progn
  186.             (set (make-local-variable 'rlab-default-application)
  187.              (buffer-substring (match-beginning 1)
  188.                        (match-end 1)))
  189.             (if (match-beginning 2)
  190.             (progn
  191.               (goto-char (match-beginning 2))
  192.               (set (make-local-variable
  193.                 'rlab-default-command-switches)
  194.                    nil)
  195.               (while (< (point) (match-end 2))
  196.                 (setq s (read (current-buffer)))
  197.                 (if (<= (point) (match-end 2))
  198.                 (setq rlab-default-command-switches
  199.                       (append rlab-default-command-switches
  200.                           (list (prin1-to-string s)))))))))
  201.         )))))
  202.     (run-hooks 'rlab-mode-hook)))
  203.  
  204. ;;}}}
  205. ;;{{{ rlab-setup-keymap
  206.  
  207. (defun rlab-setup-keymap ()
  208.   "Set up keymap for rlab mode.
  209. If the variable `rlab-prefix-key' is nil, the bindings go directly
  210. to `rlab-mode-map', otherwise they are prefixed with `rlab-prefix-key'."
  211.   (setq rlab-mode-map (make-sparse-keymap))
  212.   (define-key rlab-mode-map [menu-bar rlab-mode]
  213.     (cons "RLaB-Mode" rlab-mode-menu))
  214.   (let ((map (if rlab-prefix-key
  215.          (make-sparse-keymap)
  216.            rlab-mode-map)))
  217.   ;; indentation
  218.   (define-key rlab-mode-map [?}] 'rlab-electric-brace)
  219.   ;; communication
  220.   (define-key map "\M-e" 'rlab-send-current-line)
  221.   (define-key map "\M-r" 'rlab-send-region)
  222.   (define-key map "\M-w" 'rlab-send-proc)
  223.   (define-key map "\M-a" 'rlab-send-buffer)
  224.   (define-key map "\M-q" 'rlab-kill-process)
  225.   (define-key map "\M-u" 'rlab-restart-with-whole-file)
  226.   (define-key map "\M-s" 'rlab-show-process-buffer)
  227.   (define-key map "\M-h" 'rlab-hide-process-buffer)
  228.   (define-key map "\M-i" 'rlab-get-error-info)
  229.   (define-key map "\M-[" 'rlab-beginning-of-proc)
  230.   (define-key map "\M-]" 'rlab-end-of-proc)
  231.   (define-key map "\C-\M-s" 'rlab-set-rlab-region-start)
  232.   (define-key map "\C-\M-e" 'rlab-set-rlab-region-end)
  233.   (define-key map "\C-\M-r" 'rlab-send-rlab-region)
  234.   (if rlab-prefix-key
  235.       (define-key rlab-mode-map rlab-prefix-key map))
  236.   ))
  237.  
  238. ;;}}}
  239. ;;{{{ indentation
  240.  
  241. ;;{{{ rlab-indent-line
  242.  
  243. (defun rlab-indent-line ()
  244.   "Indent current line as rlab code.
  245. Return the amount the indentation changed by."
  246.   (let ((indent (rlab-calculate-indentation nil))
  247.     beg shift-amt
  248.     (case-fold-search nil)
  249.     (pos (- (point-max) (point))))
  250.     (beginning-of-line)
  251.     (setq beg (point))
  252.     (skip-chars-forward " \t")
  253.     (save-excursion
  254.       (while (eq (following-char) ?})
  255.     (setq indent (max (- indent rlab-indent-level) 0))
  256.     (forward-char 1)
  257.     (if (looking-at "\\([ \t]*\\)}")
  258.         (progn
  259.           (delete-region (match-beginning 1) (match-end 1))
  260.           (insert-char ?  (1- rlab-indent-level))))))
  261.     (setq shift-amt (- indent (current-column)))
  262.     (if (zerop shift-amt)
  263.     (if (> (- (point-max) pos) (point))
  264.         (goto-char (- (point-max) pos)))
  265.       (delete-region beg (point))
  266.       (indent-to indent)
  267.       ;; If initial point was within line's indentation,
  268.       ;; position after the indentation.  Else stay at same point in text.
  269.       (if (> (- (point-max) pos) (point))
  270.       (goto-char (- (point-max) pos))))
  271.     shift-amt))
  272.  
  273. ;;}}}
  274. ;;{{{ rlab-calculate-indentation
  275.  
  276. (defun rlab-calculate-indentation (&optional parse-start)
  277.   "Return appropriate indentation for current line as rlab code.
  278. In usual case returns an integer: the column to indent to."
  279.   (let ((pos (point)))
  280.     (save-excursion
  281.       (if parse-start
  282.       (setq pos (goto-char parse-start)))
  283.       (beginning-of-line)
  284.       (if (bobp)
  285.       (current-indentation)
  286.     (forward-char -1)
  287.     (if (eq (preceding-char) ?\\)
  288.         (+ (current-indentation)
  289.            (progn
  290.          (beginning-of-line)
  291.          (if (bobp)
  292.              (* 2 rlab-indent-level)
  293.            (forward-char -1)
  294.            (if (not (eq (preceding-char) ?\\))
  295.                (* 2 rlab-indent-level)
  296.              0))))
  297.       (forward-char 1)
  298.       (if (re-search-backward
  299.            "\\(^[^ \t\n\r]\\)\\|\\({\\s *\n\\)\\|\\(}\\s *\n\\)"
  300.            nil  t)
  301.           (+ (- (current-indentation)
  302.             (if (save-excursion
  303.               (beginning-of-line)
  304.               (and (not (bobp))
  305.                    (progn
  306.                  (forward-char -1)
  307.                  (eq (preceding-char) ?\\))))
  308.             (* 2 rlab-indent-level)
  309.               0))
  310.          (if (eq (following-char) ?{)
  311.              rlab-indent-level
  312.            0))
  313.         (goto-char pos)
  314.         (beginning-of-line)
  315.         (forward-line -1)
  316.         (current-indentation)))))))
  317.  
  318. ;;}}}
  319. ;;{{{ rlab-electric-brace
  320.  
  321. (defun rlab-electric-brace (arg)
  322.   "Insert `}' and indent line for rlab."
  323.   (interactive "P")
  324.   (insert-char ?} (prefix-numeric-value arg))
  325.   (rlab-indent-line)
  326.   (blink-matching-open))
  327.  
  328. ;;}}}
  329.  
  330. ;;}}}
  331. ;;{{{ searching
  332.  
  333. ;;{{{ rlab-beginning-of-proc
  334.  
  335. (defun rlab-beginning-of-proc (&optional arg)
  336.   "Move backward to the beginning of a rlab proc (or similar).
  337. With argument, do it that many times.  Negative arg -N
  338. means move forward to Nth following beginning of proc.
  339. Returns t unless search stops due to beginning or end of buffer."
  340.   (interactive "P")
  341.   (or arg
  342.       (setq arg 1))
  343.   (let ((found nil)
  344.     (ret t))
  345.     (if (and (< arg 0)
  346.          (looking-at "^[^ \t\n#][^\n]*{[ \t]*$"))
  347.     (forward-char 1))
  348.     (while (< arg 0)
  349.       (if (re-search-forward "^[^ \t\n#][^\n]*{[ \t]*$" nil t)
  350.       (setq arg (1+ arg)
  351.         found t)
  352.     (setq ret nil
  353.           arg 0)))
  354.     (if found
  355.     (beginning-of-line))
  356.     (while (> arg 0)
  357.       (if (re-search-backward "^[^ \t\n#][^\n]*{[ \t]*$" nil t)
  358.       (setq arg (1- arg))
  359.     (setq ret nil
  360.           arg 0)))
  361.     ret))
  362.  
  363. ;;}}}
  364. ;;{{{ rlab-end-of-proc
  365.  
  366. (defun rlab-end-of-proc (&optional arg)
  367.   "Move forward to next end of rlab proc (or similar).
  368. With argument, do it that many times.  Negative argument -N means move
  369. back to Nth preceding end of proc.
  370.  
  371. This function just searches for a `}' at the beginning of a line."
  372.   (interactive "P")
  373.   (or arg
  374.       (setq arg 1))
  375.   (let ((found nil)
  376.     (ret t))
  377.     (if (and (< arg 0)
  378.          (not (bolp))
  379.          (save-excursion
  380.            (beginning-of-line)
  381.            (eq (following-char) ?})))
  382.     (forward-char -1))
  383.     (while (> arg 0)
  384.       (if (re-search-forward "^}" nil t)
  385.       (setq arg (1- arg)
  386.         found t)
  387.     (setq ret nil
  388.           arg 0)))
  389.     (while (< arg 0)
  390.       (if (re-search-backward "^}" nil t)
  391.       (setq arg (1+ arg)
  392.         found t)
  393.     (setq ret nil
  394.           arg 0)))
  395.     (if found
  396.     (end-of-line))
  397.     ret))
  398.  
  399. ;;}}}
  400.  
  401. ;;}}}
  402. ;;{{{ communication with a inferior process via comint
  403.  
  404. ;;{{{ rlab-start-process
  405.  
  406. (defun rlab-start-process (name program &optional startfile &rest switches)
  407.   "Start a rlab process named NAME, running PROGRAM."
  408.   (or switches
  409.       (setq switches rlab-default-command-switches))
  410.   (setq rlab-process-buffer (apply 'make-comint name program startfile switches))
  411.   (setq rlab-process (get-buffer-process rlab-process-buffer))
  412.   (save-excursion
  413.     (set-buffer rlab-process-buffer)
  414.     (setq comint-prompt-regexp "^[^% ]*%\\( %\\)* *"))
  415.   )
  416.  
  417. ;;}}}
  418. ;;{{{ rlab-kill-process
  419.  
  420. (defun rlab-kill-process ()
  421.   "Kill rlab subprocess and its buffer."
  422.   (interactive)
  423.   (if rlab-process-buffer
  424.       (kill-buffer rlab-process-buffer)))
  425.  
  426. ;;}}}
  427. ;;{{{ rlab-set-rlab-region-start
  428.  
  429. (defun rlab-set-rlab-region-start (&optional arg)
  430.   "Set start of region for use with `rlab-send-rlab-region'."
  431.   (interactive)
  432.   (set-marker rlab-region-start (or arg (point))))
  433.  
  434. ;;}}}
  435. ;;{{{ rlab-set-rlab-region-end
  436.  
  437. (defun rlab-set-rlab-region-end (&optional arg)
  438.   "Set end of region for use with `rlab-send-rlab-region'."
  439.   (interactive)
  440.   (set-marker rlab-region-end (or arg (point))))
  441.  
  442. ;;}}}
  443. ;;{{{ send line/region/buffer to rlab-process
  444.  
  445. ;;{{{ rlab-send-current-line
  446.  
  447. (defun rlab-send-current-line ()
  448.   "Send current line to rlab subprocess, found in `rlab-process'.
  449. If `rlab-process' is nil or dead, start a new process first."
  450.   (interactive)
  451.   (let ((start (save-excursion (beginning-of-line) (point)))
  452.     (end (save-excursion (end-of-line) (point))))
  453.     (or (and rlab-process
  454.          (eq (process-status rlab-process) 'run))
  455.     (rlab-start-process rlab-default-application rlab-default-application))
  456.     (comint-simple-send rlab-process (buffer-substring start end))
  457.     (forward-line 1)
  458.     (if rlab-always-show
  459.     (display-buffer rlab-process-buffer))))
  460.  
  461. ;;}}}
  462. ;;{{{ rlab-send-region
  463.  
  464. (defun rlab-send-region (start end)
  465.   "Send region to rlab subprocess, wrapped in `eval { ... }'."
  466.   (interactive "r")
  467.   (or (and rlab-process
  468.        (comint-check-proc rlab-process-buffer))
  469.       (rlab-start-process rlab-default-application rlab-default-application))
  470.   (comint-simple-send rlab-process
  471.               (concat rlab-default-eval
  472.                   " "(buffer-substring start end) " "))
  473.   (if rlab-always-show
  474.       (display-buffer rlab-process-buffer)))
  475.  
  476. ;;}}}
  477. ;;{{{ rlab-send-rlab-region
  478.  
  479. (defun rlab-send-rlab-region ()
  480.   "Send preset rlab region to rlab subprocess, wrapped in `eval { ... }'."
  481.   (interactive)
  482.   (or (and rlab-region-start rlab-region-end)
  483.       (error "rlab-region not set"))
  484.   (or (and rlab-process
  485.        (comint-check-proc rlab-process-buffer))
  486.       (rlab-start-process rlab-default-application rlab-default-application))
  487.   (comint-simple-send rlab-process
  488.               (concat rlab-default-eval
  489.                   " "
  490.                   (buffer-substring rlab-region-start rlab-region-end)
  491.                   " "))
  492.   (if rlab-always-show
  493.       (display-buffer rlab-process-buffer)))
  494.  
  495. ;;}}}
  496. ;;{{{ rlab-send-proc
  497.  
  498. (defun rlab-send-proc ()
  499.   "Send proc around point to rlab subprocess, wrapped in `eval { ... }'."
  500.   (interactive)
  501.   (let (beg end)
  502.     (save-excursion
  503.       (rlab-beginning-of-proc)
  504.       (setq beg (point))
  505.       (rlab-end-of-proc)
  506.       (setq end (point)))
  507.     (or (and rlab-process
  508.          (comint-check-proc rlab-process-buffer))
  509.     (rlab-start-process rlab-default-application rlab-default-application))
  510.     (comint-simple-send rlab-process
  511.             (concat rlab-default-eval
  512.                 " "
  513.                 (buffer-substring beg end)
  514.                 " "))
  515.     (if rlab-always-show
  516.     (display-buffer rlab-process-buffer))))
  517.  
  518. ;;}}}
  519. ;;{{{ rlab-send-buffer
  520.  
  521. (defun rlab-send-buffer ()
  522.   "Send whole buffer to rlab subprocess, wrapped in `eval { ... }'."
  523.   (interactive)
  524.   (or (and rlab-process
  525.        (comint-check-proc rlab-process-buffer))
  526.       (rlab-start-process rlab-default-application rlab-default-application))
  527.   (if (buffer-modified-p)
  528.       (comint-simple-send rlab-process
  529.               (concat
  530.                rlab-default-eval
  531.                " "
  532.                (buffer-substring (point-min) (point-max))
  533.                " "))
  534.     (comint-simple-send rlab-process
  535.             (concat "load(\""
  536.                 (buffer-file-name)
  537.                 "\")")))
  538.   (if rlab-always-show
  539.       (display-buffer rlab-process-buffer)))
  540.  
  541. ;;}}}
  542.  
  543. ;;}}}
  544. ;;{{{ rlab-get-error-info
  545.  
  546. (defun rlab-get-error-info ()
  547.   "Send string `set errorInfo' to rlab subprocess and display the rlab buffer."
  548.   (interactive)
  549.   (or (and rlab-process
  550.        (comint-check-proc rlab-process-buffer))
  551.       (rlab-start-process rlab-default-application rlab-default-application))
  552.   (comint-simple-send rlab-process "set errorInfo\n")
  553.   (display-buffer rlab-process-buffer))
  554.  
  555. ;;}}}
  556. ;;{{{ rlab-restart-with-whole-file
  557.  
  558. (defun rlab-restart-with-whole-file ()
  559.   "Restart rlab subprocess and send whole file as input."
  560.   (interactive)
  561.   (rlab-kill-process)
  562.   (rlab-start-process rlab-default-application rlab-default-application)
  563.   (rlab-send-buffer))
  564.   
  565. ;;}}}  
  566. ;;{{{ rlab-show-process-buffer
  567.  
  568. (defun rlab-show-process-buffer ()
  569.   "Make sure `rlab-process-buffer' is being displayed."
  570.   (interactive)
  571.   (display-buffer rlab-process-buffer))
  572.  
  573. ;;}}}
  574. ;;{{{ rlab-hide-process-buffer
  575.  
  576. (defun rlab-hide-process-buffer ()
  577.   "Delete all windows that display `rlab-process-buffer'."
  578.   (interactive)
  579.   (delete-windows-on rlab-process-buffer))
  580.  
  581. ;;}}}
  582.  
  583. ;;}}}
  584.  
  585. ;;{{{ menu bar
  586.  
  587. (define-key rlab-mode-menu [restart-with-whole-file]
  588.   '("Restart With Whole File" .  rlab-restart-with-whole-file))
  589. (define-key rlab-mode-menu [kill-process]
  590.   '("Kill Process" . rlab-kill-process))
  591.  
  592. (define-key rlab-mode-menu [hide-process-buffer]
  593.   '("Hide Process Buffer" . rlab-hide-process-buffer))
  594. (define-key rlab-mode-menu [get-error-info]
  595.   '("Get Error Info" . rlab-get-error-info))
  596. (define-key rlab-mode-menu [show-process-buffer]
  597.   '("Show Process Buffer" . rlab-show-process-buffer))
  598.  
  599. (define-key rlab-mode-menu [end-of-proc]
  600.   '("End Of Proc" . rlab-end-of-proc))
  601. (define-key rlab-mode-menu [beginning-of-proc]
  602.   '("Beginning Of Proc" . rlab-beginning-of-proc))
  603.  
  604. (define-key rlab-mode-menu [send-rlab-region]
  605.   '("Send RLaB-Region" . rlab-send-rlab-region))
  606. (define-key rlab-mode-menu [set-rlab-regio-end]
  607.   '("Set RLaB-Region End" . rlab-set-rlab-region-end))
  608. (define-key rlab-mode-menu [set-rlab-region-start]
  609.   '("Set RLaB-Region Start" . rlab-set-rlab-region-start))
  610.  
  611. (define-key rlab-mode-menu [send-current-line]
  612.   '("Send Current Line" . rlab-send-current-line))
  613. (define-key rlab-mode-menu [send-region]
  614.   '("Send Region" . rlab-send-region))
  615. (define-key rlab-mode-menu [send-proc]
  616.   '("Send Proc" . rlab-send-proc))
  617. (define-key rlab-mode-menu [send-buffer]
  618.   '("Send Buffer" . rlab-send-buffer))
  619.  
  620. ;;}}}
  621.  
  622. ;;{{{ Emacs local variables
  623.  
  624.  
  625. ;; Local Variables:
  626. ;; folded-file: t
  627. ;; End:
  628.  
  629. ;;}}}
  630.  
  631. ;;; rlab-mode.el ends here
  632.